package com.example.hhh.cpkotlinversion.core.ui

import android.graphics.Color
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.support.v4.view.ViewPager
import android.view.View
import android.widget.GridView
import android.widget.TextView
import android.widget.Toast
import com.example.hhh.cpkotlinversion.R

class Home : AppCompatActivity() {
      private  var mTvTitle :TextView?=null
    private var mVp:ViewPager?=null
    private var mGridView:GridView?=null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_home)

        initView()
        initViewInfo()
    }



    fun initView() :Unit{
    mTvTitle = findViewById(R.id.title) as TextView
    mVp = findViewById(R.id.vp) as ViewPager
    mGridView=findViewById(R.id.gv) as GridView


    }
    private fun initViewInfo() {
        mTvTitle?.text="加减信息"
        mTvTitle?.setBackgroundColor(Color.BLACK)
        mTvTitle?.setTextColor(Color.WHITE)
        mTvTitle!!.setOnClickListener { view: View? ->
            Toast.makeText(this,"成功啦",Toast.LENGTH_SHORT).show()
        }

    }
}
